package Window;


import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class WindowFrame {
	public static void main(String args[]){
		new Win();
	}
}


class Win extends JFrame implements ActionListener{
	JLabel label=new JLabel();
	JPanel pl1;
	JMenu menu1,menu2;
	JMenuItem item1=new JMenuItem("浏览荆州古城景点");
	JMenuItem item2=new JMenuItem("输入出发点和目的地");
	JMenuItem item3=new JMenuItem("景点管理");
	JMenuBar bar=new JMenuBar();
	Win(){
		pl1=new JPanel();
		setJMenuBar(bar);
		ImageIcon icon = new ImageIcon("src/image/1.jpg");
		label.setIcon(icon);
		label.setBounds(0,0, 600, 450);
		pl1.add(label);
		add(pl1);
		setBounds(600,300,600,450);
		menu1=new JMenu("景点信息");
		menu2=new JMenu("查询路径与管理");
		menu1.add(item1);
		menu2.add(item2);
		menu2.add(item3);
		bar.add(menu1);
		bar.add(menu2);
		item1.addActionListener(this);
		item2.addActionListener(this);
		item3.addActionListener(this);
		setTitle("荆州古城景点导览系统");
		setVisible(true);
		validate();

	}

	public void actionPerformed(ActionEvent e) {
		if(e.getSource()==item1){
			LookFrame message=new LookFrame();
			message.setVisible(true);
		}
		if (e.getSource()==item3) {
			NewFrame route=new NewFrame();
			route.setVisible(true);
		}
		if (e.getSource()==item2) {
			PathFrame condition=new PathFrame();
			condition.setVisible(true);
		}

	}

}






